// 所有的常量
const constants = {
	// http请求常量配置
	HTTP_CONFIG: {
		method: {
			post: 'POST',
			get: 'GET',
			put: 'PUT',
			delete: 'DELETE'
		},
		baseUrl: 'http://11795935.r25.cpolar.top',
		timeout: 5000,
		contentType: {
			"JSON": 'application/json;charset=UTF-8',
			"FORMDATA": 'multipart/form-data',
			"DEFAULT": 'application/x-www-form-urlencoded'
		},
		httpCode: [{
				minCode: 100,
				maxCode: 199,
				desc: '请求被接受，需要继续处理'
			},
			{
				minCode: 300,
				maxCode: 399,
				desc: '请求被重定向'
			},
			{
				minCode: 400,
				maxCode: 499,
				desc: '请求被拒绝'
			},
			{
				minCode: 500,
				maxCode: 599,
				desc: '服务器错误，请稍后再试'
			},
		]
	},
	VALIDATE_CONFIG: {
		phoneNum: {
			regExp: /^1[3|5|6|7|8|9][0-9]{9}$/,
			tipInfo: '请输入11位手机号码'
		},
		account: {
			regExp: /^1[3|5|6|7|8|9][0-9]{9}$/,
			tipInfo: '请输入11位手机号码'
		},
		password: {
			regExp: /^\S{6,18}$/,
			tipInfo: '请输入6-18位密码'
		},
		msgCode: {
			regExp: /^\d{6}$/,
			tipInfo: '请输入6位数字验证码'
		},
		name: {
			regExpStr: /^\S{2,20}$/,
			tipInfo: '用户名为2-20个字'
		},
		email: {
			regExpStr: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/,
			tipInfo: '请输入正确的邮箱地址'
		},
		age: {
			regExpStr: /^(0?[1-9]|[1-9][0-9])|^120$/,
			tipInfo: '年龄为1-120岁'
		},
		introduce: {
			regExpStr: /^\S{10,300}$/,
			tipInfo: '自我介绍为10-300字'
		}
	}
}

export default constants